
 /*
  * Team Java
  * This is a PCB ADT along with it's dependencies ADT's
  * Author(s): Michael Satran Jr, Michael Pogson, Stephen Hunter
  * Date: 5/31/2012
  */

 #ifndef PCB_H_INCLUDED
 #define PCB_H_INCLUDED

 #define MAX_REQUESTS 100

 typedef enum PROCESS_STATE
 {
	state_init,
	state_ready,
	state_running,
	state_blocked,
	state_interrupted,
	state_terminated,
 } State;


 typedef enum PROCESS_REQUEST
 {
	io_system_call,
	mutex_acquire_system_call,
	mutex_give_system_call,
	mem_write_system_call,
	mem_read_system_call

 } Request;

 typedef unsigned int Register;


 typedef struct process
 {
	//The amount of steps which are in this process.
	int steps_n;
	//The amount of requests which this process has.
	int requests_n;
	//The requests (as a name) this process contains.
	Request requests[MAX_REQUESTS];
	//Process code (in the form of a function pointer)
	//void (*function_ptr)(void);
 } Process;

 //Process Control Block
 typedef struct pcb
 {
	//Process ID
	int id;
	//Process State
	State state;
	//Stack pointer
	int sp;
	//Frame pointer
	int fp;
	//Program Counter
	int pc;
	//Process
	Process *proc;
	//Register File
	Register rf[32];
 } PCB;

 #endif